package com.xx.sg.own.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xx.sg.handler.ListStrToStringHandler;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("sg_fire_info_handle")
public class FireInfoHandle {

    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    //报警事件编号
    @TableField(value = "alarm_id")
    private String alarmId;

    //处置人
    @TableField(value = "user_id", typeHandler = ListStrToStringHandler.class)
    private List<String> userIds;

    @TableField(exist = false)
    private List<User> users;

    //部门
    @TableField(value = "dept_id")
    private String deptId;

    @TableField(exist = false)
    private Dept dept;

    //无人机流
    @TableField(value = "stream")
    private String stream;

    //处置内容
    @TableField(value = "content")
    private String content;

    //发送人员拼接
    @TableField(value = "message_men")
    private String messageMen;

    //处置时间
    @TableField(value = "datetime")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime datetime;

}
